﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;


namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class UTallySurveyList : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看, Permission.删除, Permission.新增 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "UTallySurveyList";
            }
        }
        #region 属性 (查询条件)



        protected string MachineType
        {
            get
            {
                return GetRequestValue<string>("MachineType", "");

            }
        }
        protected string SerialNumber
        {
            get
            {
                return GetRequestValue<string>("SerialNumber", "");

            }
        }

        protected string AgentName
        {
            get
            {
                return GetRequestValue<string>("AgentName", "");

            }
        }



        protected string SurveyDateFrom
        {
            get
            {
                return GetRequestValue<string>("SurveyDateFrom", "");

            }
        }

        protected string SurveyDateTo
        {
            get
            {
                return GetRequestValue<string>("SurveyDateTo","");

            }
        }

        protected int IsKeep
        {
            get
            {
                return GetRequestValue<int>("IsKeep", -1);
            }
        }


        protected override string orderField
        {
            get
            {
                return GetRequestValue<string>("orderfield", "IsKeep");
            }
        }

        protected override string orderDirection
        {
            get
            {
                return GetRequestValue<string>("orderDirection", "asc");
            }
        }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            DataBind();
        }

        protected void DataBind()
        {
            //  string wheresql = QueryOperatorsEnumHelper.ConvertCommonOperator(CommonFiled, QueryOperatorsEnum.包含, CommonValue);

            this.rpMenu.DataSource = UTallySurveyController.GetPagination(MachineType, SerialNumber, AgentName, SurveyDateFrom, SurveyDateTo, IsKeep, pageNum, numPerPage, SQLSort, ref TotalCount);
            this.rpMenu.DataBind();
        }
    }
}